package mysql

type AdminInfo struct {
	Id         uint `gorm:"column:id;primary_key" json:"id" form:"id"`
	Status     int  `gorm:"column:status" json:"status" form:"status"`
	Deleted    int  `gorm:"column:deleted" json:"deleted"`
	AddTime    int32 `gorm:"column:add_time" json:"add_time"`
	UpdateTime int32 `gorm:"column:update_time" json:"update_time"`
	Memo       string `gorm:"column:memo" json:"memo" form:"memo"`
	Sitename string `gorm:"column:sitename" json:"sitename" form:"sitename" binding:"required"`
	Keywords string `gorm:"column:keywords" json:"keywords" form:"keywords" binding:"required"`
	Logo string `gorm:"column:logo" json:"logo" form:"logo" binding:"required"`
	Descript string `gorm:"column:descript" json:"descript" form:"descript" binding:"required"`
	Copyright string  `gorm:"column:copyright" json:"copyright" form:"copyright" binding:"required"`

}
//这一步的意思是改表明的  默认表明是带s的
func (AdminInfo) TableName() string  {
	return "k_admin_sys_info"
}

func (info AdminInfo) GetItem() AdminInfo{
	db := Db
	infos := AdminInfo{}
	db.First(&infos,43)
	return infos
}

func (info AdminInfo) SaveItem(adminInfo *AdminInfo) error{
	db := Db
	return db.Save(&adminInfo).Error
}

